package com.ta.gulimall.product.service.impl;

import com.ta.gulimall.product.view.pto.SpuDto;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ta.gulimall.product.dao.SpuInfoDescDao;
import com.ta.gulimall.product.view.entity.SpuInfoDescEntity;
import com.ta.gulimall.product.service.SpuInfoDescService;


@Service("spuInfoDescService")
public class SpuInfoDescServiceImpl extends ServiceImpl<SpuInfoDescDao, SpuInfoDescEntity> implements SpuInfoDescService {

    @Override
    public void saveSpuInfoDesc(SpuDto spuDto, List<String> decript) {
        String decr = decript.stream().collect(Collectors.joining(","));
        SpuInfoDescEntity spuInfoDesc = SpuInfoDescEntity.builder().spuId(spuDto.getSpuId()).decript(decr).build();
        this.save(spuInfoDesc);
    }

}